from django.contrib import admin
from web.models import *

from import_export import resources
from import_export.admin import ImportExportModelAdmin, ImportExportActionModelAdmin


class ProxyResource(resources.ModelResource):
    class Meta:
        model = Account


# Register your models here.
@admin.register(Account)
class AccountAdmin(admin.ModelAdmin):
    # class AccountAdmin(ImportExportModelAdmin):
    # class AccountAdmin(ImportExportActionModelAdmin):
    resource_class = ProxyResource
    # 需要搜索的字段
    search_fields = ('name',)

    list_display = ('id', 'name', 'password', 'point')

    list_display_links = ('name',)

    list_per_page = 10

    readonly_fields = ('name', 'password', 'question', 'answer', 'email', 'qq', 'tel', 'id_type', 'id_card')


